package com.gitee.qdbp.general.thirdpart.biz.amap.model;

import java.util.Properties;
import com.gitee.qdbp.general.thirdpart.biz.amap.service.AmapHttpExecutor;
import com.gitee.qdbp.tools.http.HostUrlConfig;
import com.gitee.qdbp.tools.utils.PropertyTools;
import com.gitee.qdbp.tools.utils.PropertyTools.Options;

/**
 * 高德地图配置项<br>
 * https://lbs.amap.com/api/webservice/guide/create-project/get-key<br>
 * amap.app.key = c73ab0c0x446ac4144x36ab86d7ee866
 *
 * @author zhaohuihua
 * @version 180717
 */
public class AmapConfig extends HostUrlConfig {

    private static final long serialVersionUID = 1L;
    /** 配置文件地址 **/
    private static final String PATH = "settings/web/amap.properties";

    public AmapConfig(Properties properties) {
        super(load(PATH, properties), "amap.host");
    }

    private static Properties load(String path, Properties properties) {
        Options options = new Options();
        options.addClasspath(AmapHttpExecutor.class);
        Properties def = PropertyTools.load(path, options);
        def.putAll(properties);
        return def;
    }
}
